/**
 * TtColLogDaoImpl.java
 * Created at 2017-3-20
 * Created by xieshuang
 * Copyright (C) 2015 BROADTEXT SOFTWARE, All rights reserved.
 */
package com.broadtext.rms.system.dao.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.broadtext.common.bean.EntityPageBean;
import com.broadtext.common.exp.DaoException;
import com.broadtext.common.repository.EntityDao;
import com.broadtext.rms.system.dao.IVsysUserDao;
import com.broadtext.rms.system.model.VSysUsers;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;

/**
 * 
 * <p>ClassName: TtColLogDaoImpl</p>
 * <p>Description: 用户（视图）dao实现类</p>
 * <p>Author: xieshuang</p>
 * <p>Date: 2017-3-20</p>
 */
@Repository("vSysUserDao")
public class VsysUserDaoImpl extends EntityDao<VSysUsers> implements IVsysUserDao {

    @SuppressWarnings("rawtypes")
    @Override
    public EntityPageBean findUserPageByRole(Map<String, Object> map, PageBounds pageBounds) throws DaoException {
        return this.findEntityPageByProperty(
                "com.broadtext.rms.system.model.VSysUsers.findUserByRole", map, pageBounds);
    }

    @SuppressWarnings("rawtypes")
    @Override
    public EntityPageBean findUserPageByRoleToAdd(Map<String, Object> map, PageBounds pageBounds) throws DaoException {
        return this.findEntityPageByProperty(
                "com.broadtext.rms.system.model.VSysUsers.findUserByRoleForAdd", map, pageBounds);
    }

    @SuppressWarnings("unchecked")
    @Override
    public List<VSysUsers> selectByUserName(String loginName) throws DaoException {
        List<VSysUsers> list;
        list = new ArrayList<VSysUsers>();
        list = super.findByProperty("com.broadtext.rms.system.model.VSysUsers.findEntityByUserName", loginName);
        return list;
    }
}
